<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/all.css" rel="stylesheet"  media="all" type="text/css" />
<title>成都</title>
</head>
<style>
  .menu li{
    padding: 6px 0px !important;
  }

</style>
<body>
<div class="head">
  <div class="main"><span class=""><img src="images/logo.jpg" width="150"/></span>
    <p class="clear"></p>
  </div>
</div>
<div class="menu">
  <div class="main">
    <ul class="center">
      <li><a href="index.html">网站首页</a></li>
      <li><a href="jieshao.html">关于成都</a></li>
      <li><a href="chihewanle.html">吃喝玩乐</a></li>
      <li><a href="tupian.html">旅游风光</a></li>
      <li><a href="zhuce.html">会员注册</a></li> 
      <li><a href="denglu.html">会员登录</a></li>
      <li><a href="tuijian.html">美食展示</a></li>
      <li><a href="liuyan.html">留言</a></li>
    </ul>
  </div>
</div>
<div class="main">
  <div class="content">
   <div class="inban"><img src="images/dl.jpg" width="100%" /> </div>

    <div class="bar">
      <h2 align="center">——欢迎登录——</h2>
    </div>
    <div class="form">
      <form id="zhuce" class="zhuce inp" name="zhuce" method="post" action="index.html">
      <div class="nam">
        <label>用户名</label>
        <div class="div">
          <input id="dlzh" name="first_name" type="text" value="请输入您的姓名" class="inp">
        </div>
      </div>
      <div class="nam">
        <label>密码</label>
        <div class="div">
          <input name="psw" type="password" size="20" maxlength="8" id="dlmm" class="inp">
        </div>
      </div>
      
      <div class="nam" style="text-align:center">
        <input name="sleep" type="button"  onclick="login(event)"value="立即登录">
      </div>
      </form>
    </div>
    <div class="clear"></div>
  </div>
</div>
<div class="end">
  <p>成都 </p>
</div>
</body>
</html>
<script>
  function login(event){
      event.preventDefault()
  var dlzh=document.querySelector("#dlzh")
  var dlmm=document.querySelector("#dlmm")
  var brr=JSON.parse(localStorage.getItem("arr"))||[]
  var b=0
  for(let i=0;i<brr.length;i++){
      if(brr[i].name==dlzh.value&&brr[i].password==dlmm.value){
         b=1
      }
  }
  if(b==1){
      
      alert("登陆成功")
      location.href="./index.html"
  }else{
      alert("账号或密码错误")

  }

}
</script>